<template>
  <div>
    <Nav></Nav>
    <div class="one">
      <div class="two">
        <div>
          <el-form ref="form" :model="search">
            <div class="searchForm">
              <el-form-item label="项目名称" label-width="80px" prop="projectName">
                <el-input v-model="search.projectName" style="width: 200px" placeholder="请输入项目名称" clearable></el-input>
              </el-form-item>
            </div>
            <div class="searchForm">
              <el-form-item label="申请时间" label-width="80px" prop="createTime">
                <el-date-picker value-format="yyyy-MM-dd HH:mm:ss" v-model="search.createTime" type="datetimerange" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期"></el-date-picker>
              </el-form-item>
            </div>
          </el-form>
        </div>
        <div>
          <el-button type="primary" @click="cmdSearch">搜索</el-button>
          <el-button type="info" @click="cmdReset">重置</el-button>
        </div>
      </div>
    </div>
    <div>
      <el-table :data="tableData" stripe style="width: 100%" @row-dblclick="dblclick">
        <el-table-column prop="processName" label="流程名称" align="center"></el-table-column>

        <el-table-column label="操作" align="center" fixed="right">
          <template slot-scope="scope" v-show="scope">
            <el-button type="primary" size="small" @click="checkOption()">查看</el-button>
          </template>
        </el-table-column>
      </el-table>
    </div>
    <div class="paginationStyle">
      <el-pagination v-if="total>0" background layout="total, prev, pager, next, jumper" :page-size="pageSize" @current-change="handleCurrentChange" :total="total"></el-pagination>
    </div>
  </div>
</template>
<script>
import { getAuditAllRecords, getFind, getAllProjectType } from '@/api/api'
import nav from '@/components/navigation'
export default {
  components: {
    Nav: nav
  },
  data () {
    return {
      search: {
        projectName: '',
        createTime: []
      },
      tableData: [],
      pageSize: 10,
      pageNum: 0,
      total: 0,
    }
  },
  mounted () {
    this.getDatas()
  },
  methods: {
    getDatas () {
      let params = {
        pageNum: this.pageNum,
        pageSize: this.pageSize
      }
      // getAuditAllRecords(params)
      //   .then((res) => {
      //     if (res.code == 200) {
      //       this.tableData = res.data.content
      //       this.total = res.data.totalElements
      //     } else {
      //       swal('错误', res.message || '网络连接错误', 'warning')
      //     }
      //   })
      //   .catch((err) => {
      //     swal('错误', '网络连接错误', 'error')
      //   })
    },
    handleCurrentChange (val) {
      this.pageNum = val - 1
      this.getDatas()
    },
    cmdSearch () {
      let params = {
        
      }
      // getFind(params).then(res => {
      //   // console.log(res)
      //   if (res.code == 200) {
      //     this.tableData = res.data.content
      //     this.total = res.data.totalElements
      //   } else {
      //     swal('错误', res.message || '网络连接错误', 'warning')
      //   }
      // }).catch((err) => {
      //   swal('错误', '网络连接错误', 'error')
      // })
    },
    cmdReset () {
      this.$refs.form.resetFields()
      this.getDatas()
    },
    dblclick (row) {
      this.$router.push({ path: '/bidding-audit-process' })
    },
    checkOption () {
      this.$router.push({ path: '/bidding-audit-process' })
    },
  },
}
</script>
<style lang="less" scoped>
.one {
  line-height: 60px;
  .el-form {
    position: relative;
    top: 12px;
    margin-right: 10px;
  }
  .two {
    display: flex;
  }

  min-height: 60px;
  background-color: rgb(255, 255, 255);
  margin-bottom: 10px;
}
.searchForm {
  display: flex;
}
.el-tag {
  margin: 0 10px 5px 0;
}
</style>